#!/usr/bin/env python3
# -*- coding: UTF-8 -*-

"""
@author: JoeyZhou
@Tool: PyCharm
@Date: 2020/2/15 12:50 PM
@desc:
"""

import os
from os import path
import yaml
from base.requests_base import RequestsBase


class EnvView(RequestsBase):

    def read_env(self):
        """
        run代表从run.py运行
        test_case代表从test_case运行
        :return:
        """
        parent_path = os.path.dirname(path.dirname(__file__))  # 获得当前目录的父级目录
        config_path = parent_path + "/config/config.yaml"
        with open(config_path, 'r', encoding='UTF-8') as file:
            data = yaml.load(file, Loader=yaml.Loader)
        return data['url']


if __name__ == '__main__':
    ev = EnvView()
    print(ev.read_env())
